import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";
import Home from "../views/Home.vue";

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/about/:id",
    name: "About",
    component: () => import(/* webpackChunkName: "about" */ "@/views/About"),
  },
];
const router = createRouter({
  // hash 模式: createWebHashHistory
  // history 模式 : createWebHistory
  // history: createWebHistory(),
  history: createWebHashHistory(),
  routes,
});

export default router;
